The following is an example of creating a heart racer animation.
library(heartRacer)
library(gganimate)
library(fit)
Loading and prepping the data.
# Reading in FIT files
ride1 <- read.fit('bikeRideFiles/ride1.FIT')
ride2 <- read.fit('bikeRideFiles/ride2.FIT')
# heartRacer wants a list of records from FIT files
record_list <- list()
record_list$ride1 <- ride1$record
record_list$ride2 <- ride2$record
Making the plots.
# Creating animation
ani_plot <- heartRace(recordList = record_list,
zoom = 11,
map_type = 'satellite')
## Warning: Ignoring unknown aesthetics: frame, cumulative
# Plotting
animation <- gganimate(ani_plot,
filename = "heartRacerAnimation.gif",
interval = 0.1)